package com.pl.config.security.oauth2;

import org.springframework.security.core.Authentication;
import org.springframework.security.oauth2.provider.AuthorizationRequest;
import org.springframework.security.oauth2.provider.approval.DefaultUserApprovalHandler;
import org.springframework.stereotype.Component;

@Component
public class MyUserApprovalHandler extends DefaultUserApprovalHandler{
	
	@Override
	public AuthorizationRequest checkForPreApproval(AuthorizationRequest authorizationRequest, Authentication userAuthentication) {
		authorizationRequest.setApproved(true);
		return authorizationRequest;
	}
}
